<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
	
	<ui:composition template="template/template.xhtml">
		<ui:define  name="page-title" >#{messages.deposito}</ui:define >
		<ui:define  name="center">
			<h:outputText styleClass="title" value="#{messages.deposito}"/>
        	<p:messages id="messages" autoUpdate="true" showSummary="true"/> 
           	
			<h:panelGrid columns="2">  
	
	 			<h:outputLabel value="#{messages.centro}" for="centro"/>
	 			<p:selectOneMenu id="centro" value="#{centroController.deposito.centro.id}">  
		            <f:selectItem itemLabel="#{messages.seleccione}" itemValue="" />  
		            <f:selectItems value="#{centroController.centros}" var="centro" itemLabel="#{centro.nome}" itemValue="#{centro.id}"/>  
		        </p:selectOneMenu> 

				<h:outputLabel for="nome" value="#{messages.nome}" /> 
          		<p:inputText id="nome" value="#{centroController.deposito.nome}" required="true"/>
	
				<h:outputLabel value="#{messages.tipo}" for="tipo"/>
	 			<p:selectOneMenu id="tipo" value="#{centroController.deposito.tipoDeposito}">  
		            <f:selectItem itemLabel="#{messages.seleccione}" itemValue="" />  
		            <f:selectItems value="#{centroController.tiposDeposito}"/>  
		        </p:selectOneMenu>
	
		 		<h:column/>
    			<h:column>
    				<p:commandButton value="#{messages.voltar}" action="centroDepositos"  ajax="false" immediate="true" /> 
    				<p:commandButton value="#{messages.guardar}" action="#{centroController.saveDepositoAction}" ajax="false"/> 
    			</h:column>
     		
			</h:panelGrid>
			
		</ui:define >
	</ui:composition>
	
</html>